<template>
  <h1>子组件的标题 ref实现数据动态渲染</h1>
  <p>姓名:{{ name }}</p>
  <button @click="saveValue">点击</button>
</template>

<script>
import { ref } from "@vue/reactivity";
export default {
  name: "HelloWorld",
  setup(props, context) {
    let name = ref("刘雨溪");
    function saveValue() {
      console.log(context);
      context.emit("ccc", 2002);
    }

    return {
      saveValue,
      name,
    };
  },
};
</script>

<style>
</style>